package com.huazi.eduorder.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author shkstart
 * @create 2021-03-30 19:43
 */
public class RandomOrderNo {
    public static String getOrderNo(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
        StringBuffer newDate= new StringBuffer (sdf.format(new Date()));
        Random random=new Random();
        for (int i = 0; i <5 ; i++) {
            int num = random.nextInt(10);
            newDate.append(num);
        }
        return newDate.toString();
    }
}
